package combine.order.impl.dao.ibatis;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Repository;

import combine.utils.dao.ibatis.IBatisEntityDao;

import combine.order.model.DataBase;
import combine.order.model.Order;

@Repository
public class OrderDaoIbatis extends IBatisEntityDao<Order> {

	@SuppressWarnings("unchecked")
	public List<Order> findOrderDaoByStatus(boolean isFinished) throws SQLException {
//		return getSqlMapClient().queryForList(
//				"combine.order.model.Order.findOrderDaoByStatus", isFinished);
		List<Order> orders = new ArrayList<Order>();
		for(Order order : DataBase.orders) {
			if(!order.getIsFinished()){
				orders.add(order);
			}
		}
		return orders;
	}
}
